{% extends "base.html" %}
{% block content %}
            {% if showmainfeature %}
            <div id="main-feature">
              {% for mainfeature in mainfeatures %}
              <div class="main-feature-image">{% if mainfeature.titleurlpath %}<a href="/articles/{{ mainfeature.titleurlpath }}">{% else %}<a href="/article?key={{ mainfeature.key }}">{% endif %}<img class="big-image"src="{% if mainfeature.imagelink %}{{ mainfeature.imagelink }}{% endif %}" alt="{% if mainfeature.imagelink %}{{ mainfeature.imagelink }}{% endif %}" /></a></div>
              <h3 class="main-feature-title">{% if mainfeature.titleurlpath %}<a href="/articles/{{ mainfeature.titleurlpath }}">{% else %}<a href="/article?key={{ mainfeature.key }}">{% endif %}{{ mainfeature.title }}</a></h3>
              <div class="main-feature-category">{% for category in mainfeature.categories %}
                <a href="/articlecategory?category={{ category }}">{{ category }}</a>{% if not forloop.last %}, {% endif %}
                {% endfor %}</div>
              <p>{{ mainfeature.summary }} {% if showdiscussions %}<span class="main-feature-commentcount"><a href="/articletopics?article={{ mainfeature.key }}">Discuss</a></span>{% endif %}</p>
              {% endfor %}
            </div>
            {% endif %}

            <div id="top-stories">
                <h3>Top Stories</h3>
                {% for article in articles %}
                {% if article.imagelink %}<div class="article-image">{% if article.titleurlpath %}<a href="/articles/{{ article.titleurlpath }}">{% else %}<a href="/article?key={{ article.key }}">{% endif %}<img class="small-image" src="{{ article.imagelink }}" /></a></div>{% endif %}
                <h3 class="article-title">{% if article.titleurlpath %}<a href="/articles/{{ article.titleurlpath }}">{% else %}<a href="/article?key={{ article.key }}">{% endif %}{{ article.title }}</a></h3>
                <div class="article-date">{{ article.date|date:"D, F d Y" }} - by {{ article.authornickname }}</div>
                <div class="article-category">{% for category in article.categories %}
                <a href="/articlecategory?category={{ category }}">{{ category }}</a>{% if not forloop.last %}, {% endif %}
                {% endfor %}</div>
                <!--{% if article.imagelink %}
                <img src="{{ article.imagelink }}">
                {% endif %}-->
                <p class="article-content">{{ article.summary }} {% if showdiscussions %}<span class="article-commentcount"><a href="/articletopics?article={{ article.key }}">Discuss</a></span>{% endif %}</p>
                {% endfor %}
            </div>
{% endblock %}